package com.itheima.controller;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.itheima.pojo.User;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;

@Controller
public class FirstController{
//	http://localhost:8080/Springmvc_Demo02//testdata
	@RequestMapping("/testJson")
	@ResponseBody
	 public User testJson(@RequestBody User user) {
		System.out.println(user);
		return user;
	}
//	@RequestMapping("/testJson")
//	@ResponseBody
//	 public String testJson() {
//		return "222222";
//	}
// 
}
